package com.yuanda.wordhot.repository;

import java.io.Serializable;

public interface IRepository<T> {
	/**
	 * Tries to get an instance of the object 
	 * @param id the id to search for
	 * @return the requested instance, or <code>null</code> if not found
	 */
	public T get(Serializable id);
	
	/**
	 * Adds a new instance of the object
	 * @param instance the instance to save
	 */
	public void add(T entity);
	
	/**
	 * Deletes the object
	 * @param instance the object to delete
	 */
	public void remove(T entity);
	
	/**
	 * Updates the information of an existing object
	 * @param instance the instance to update
	 */
	public void update(T entity);
}
